#ifndef reader_h
#define reader_h



#include "itkImage.h"
#include "itkImageFileReader.h"

namespace FPTK{




template<class PixelType,unsigned int Dimension>
class reader
{
   public:

      typedef itk::Image< PixelType,Dimension>   ImageType;
      typedef itk::ImageFileReader<ImageType>  ReaderType;
      typedef typename ReaderType::Pointer ReaderTypePointer;
      typedef typename ImageType::SizeType ImageTypeSizeType;
      reader();
      ~reader();
      ImageType* GetOutput();
      char* GetName();
      bool IsLoaded();
      int SetInput(char *_filename);
      int Update();
      double GetSize(int i);
      void Setostream(std::ostream *_out) {out=_out;}

   private:
      std::ostream *out;
      ReaderTypePointer ptreader;
      ImageTypeSizeType size;
      bool loaded;
      char *filename;
};
}//end of FPTK namespace

#include "Reader.cxx"
#endif